<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>添加管理员</title>

	<link href="http://g.alicdn.com/sj/dpl/1.5.1/css/sui.min.css" rel="stylesheet">
	<script type="text/javascript" src="http://g.alicdn.com/sj/lib/jquery/dist/jquery.min.js"></script>
	<script type="text/javascript" src="http://g.alicdn.com/sj/dpl/1.5.1/js/sui.min.js"></script>
	<link rel="stylesheet" href="styles/backstage.css">
	<script type="text/javascript">
		function check(){
			
			if(document.getElementById('username').value == ''){
				alert("请输入名称!");
				return false;
			}


			if(document.getElementById('password').value == ''){
				alert("请输入密码!");
				return false;
			}

			return checkAdmin();
			
			
		}
		function checkAdmin(){
			var url = "doAdminAction.php?act=checkAdmin";  
			var name = document.getElementById('username').value
			var flag = true;
			$.ajax({  
				type: "POST",  
				url: url,  
				async: false,
			// dataType: "json",  
			data: {username:name},  
			success: function(msg){ 
				if(msg){
					alert(msg); 
					flag = false;
				}
			}
		});
			return flag;
		}

	</script>
</head>
<body>
<h3>添加管理员</h3>
<center>
<form action="doAdminAction.php?act=addAdmin" method="post" onsubmit="return check()">
<table  cellpadding="5" cellspacing="0"  class="table" >
	<tr>
		<!-- <td align="right" >管理员名称</td>  -->
		<th align="right" >管理员名称</th>
		<td ><input type="text" id="username" name="username" class="search" placeholder="请输入名称"/></td>
	</tr>
	<tr>
		<th align="right" >管理员密码</th>
		<td><input type="password" id="password" class="search" name="password" placeholder="请输入密码"/></td>
	</tr>
	<tr>
		<th align="right" >管理员邮箱</th>
		<td><input type="text" name="email" class="search" placeholder="请输入邮箱"/></td>
	</tr>
	<tr>
		<td colspan="2" align="center"><input type="submit" class="btn" value="添加管理员"/></td>
		
	</tr>

</table>



</form>
</center>
</body>
</html>